package a.oschina.observedemo.demo1;

/**
 * &lt;功能详细描述&gt;
 *
 * @author Administrator
 * @version [版本号, 2018/10/23]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
public class Test1 {

    public static void main(String[] args) {
        //前台小姐
        Secretary secretary = new Secretary();
        //股票同事
        StockObserver s1 = new StockObserver("马化腾", secretary);
        StockObserver s2 = new StockObserver("马云", secretary);
        //前台同事记下股票同事
        secretary.attach(s1);
        secretary.attach(s2);


        //发现老板回来
        secretary.setAction("老板回来了");
        //通知两位同事
        secretary.notifyObserver();

    }
}
